<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Assembler (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Assembler (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Assembler (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="RTL.html" rel="up" title="RTL">
<link href="Debug-Information.html" rel="next" title="Debug Information">
<link href="Incdec.html" rel="prev" title="Incdec">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="section-level-extent" id="Assembler">
<div class="nav-panel">
<p>
Next: <a href="Debug-Information.html" accesskey="n" rel="next">Variable Location Debug Information in RTL</a>, Previous: <a href="Incdec.html" accesskey="p" rel="prev">Embedded Side-Effects on Addresses</a>, Up: <a href="RTL.html" accesskey="u" rel="up">RTL Representation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Assembler-Instructions-as-Expressions"><span>14.17 Assembler Instructions as Expressions<a class="copiable-link" href="#Assembler-Instructions-as-Expressions"> &para;</a></span></h3>
<a class="index-entry-id" id="index-assembler-instructions-in-RTL"></a>

<a class="index-entry-id" id="index-asm_005foperands_002c-usage"></a>
<p>The RTX code <code class="code">asm_operands</code> represents a value produced by a
user-specified assembler instruction.  It is used to represent
an <code class="code">asm</code> statement with arguments.  An <code class="code">asm</code> statement with
a single output operand, like this:
</p>
<div class="example smallexample">
<pre class="example-preformatted">asm (&quot;foo %1,%2,%0&quot; : &quot;=a&quot; (outputvar) : &quot;g&quot; (x + y), &quot;di&quot; (*z));
</pre></div>

<p>is represented using a single <code class="code">asm_operands</code> RTX which represents
the value that is stored in <code class="code">outputvar</code>:
</p>
<div class="example smallexample">
<pre class="example-preformatted">(set <var class="var">rtx-for-outputvar</var>
     (asm_operands &quot;foo %1,%2,%0&quot; &quot;a&quot; 0
                   [<var class="var">rtx-for-addition-result</var> <var class="var">rtx-for-*z</var>]
                   [(asm_input:<var class="var">m1</var> &quot;g&quot;)
                    (asm_input:<var class="var">m2</var> &quot;di&quot;)]))
</pre></div>

<p>Here the operands of the <code class="code">asm_operands</code> RTX are the assembler
template string, the output-operand&rsquo;s constraint, the index-number of the
output operand among the output operands specified, a vector of input
operand RTX&rsquo;s, and a vector of input-operand modes and constraints.  The
mode <var class="var">m1</var> is the mode of the sum <code class="code">x+y</code>; <var class="var">m2</var> is that of
<code class="code">*z</code>.
</p>
<p>When an <code class="code">asm</code> statement has multiple output values, its insn has
several such <code class="code">set</code> RTX&rsquo;s inside of a <code class="code">parallel</code>.  Each <code class="code">set</code>
contains an <code class="code">asm_operands</code>; all of these share the same assembler
template and vectors, but each contains the constraint for the respective
output operand.  They are also distinguished by the output-operand index
number, which is 0, 1, &hellip; for successive output operands.
</p>
</div>



</body>
</html>
